/*
 * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.iec.edp.caf.security.core;

import io.iec.edp.caf.security.core.details.User;

import java.io.Serializable;
import java.util.*;

/**
 * This is {@link UserDetails}.
 *
 * @author yisiqi
 * @since 1.0.0
 */
@SuppressWarnings("unused")
public interface UserDetails extends Serializable {
    @Deprecated
    boolean secretMatches(String secret);
    @Deprecated
    String getId();
    @Deprecated
    String getUsername();

    Optional<String> getFullNameEn();

    void setFullNameEn(String fullNameEn);
    @Deprecated
    Optional<String> getMail();
    @Deprecated
    Optional<String> getPhone();
    @Deprecated
    Optional<String> getCurrentTenantId();
    @Deprecated
    Optional<List<String>> getTenantIds();
    @Deprecated
    Optional<String> getNickName();
    @Deprecated
    Optional<String> getFullName();
    @Deprecated
    Optional<String> getFirstName();
    @Deprecated
    Optional<String> getMiddleName();
    @Deprecated
    Optional<String> getLastName();
    @Deprecated
    Optional<String> getTitle();
    @Deprecated
    Optional<Locale> getLocale();
    @Deprecated
    Optional<String> getTimezone();
    @Deprecated
    UserDetailsSource getUserDetailsSource();
    @Deprecated
    boolean isAccountNonExpired();
    @Deprecated
    boolean isAccountNonLocked();
    @Deprecated
    boolean isCredentialsNonExpired();
    @Deprecated
    boolean isEnabled();
    @Deprecated
    boolean isWeakPassword();


    @Deprecated
    boolean isBoundLocalUser();
    @Deprecated
    Optional<String> getExternalAttributeAsString(String attributeName);
    @Deprecated
    Collection<? extends GrantedAuthority> getAuthorities();

    void updateExternalAttribute(Map<String,String> attributes);

    User getUser();

}
